<ui:composition xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui" 
	xmlns:f="http://java.sun.com/jsf/core">
	<p:dialog closeOnEscape="true" header="#{msgs.userCreation}" id="dialogUserCreation" modal="true" resizable="false" widgetVar="dialogUserCreationVar" width="340">
		<h:form id="userCreationForm">
			<h:panelGrid columns="3" id="inputGrid">
				<h:outputText value="#{msgs.id}*: "/>
				<p:inputText id="inputId" required="true" value="#{usersAdministrationController.userToCreate.login}" />
				<p:message display="icon" for="inputId"/>
				<h:outputText value="#{msgs.password}*: " />
				<p:password id="inputPwd" inline="true" feedback="true" goodLabel="#{msgs.good}" promptLabel="#{msgs.pleaseEnterPassword}" strongLabel="#{msgs.strong}" value="#{usersAdministrationController.userToCreate.password}" weakLabel="#{msgs.weak}"/>
				<p:message display="icon" for="inputPwd"/>
				<h:outputText value="#{msgs.name}*: "/>
				<p:inputText id="inputName" required="true" value="#{usersAdministrationController.userToCreate.name}"/>
				<p:message display="icon" for="inputName"/>
				<h:outputText value="#{msgs.firstName}*: "/>
				<p:inputText id="inputFirstName" required="true" value="#{usersAdministrationController.userToCreate.lastName}"/>
				<p:message display="icon" for="inputFirstName"/>
				<h:outputText value="#{msgs.service}*: "/>
				<h:selectOneMenu id="inputService" required="true" value="#{usersAdministrationController.userToCreate.serviceId}">
					<f:selectItems value="#{usersAdministrationController.servicesList}" />
				</h:selectOneMenu>
				<p:message display="icon" for="inputService" />
				<h:outputText value="#{msgs.job}*: "/>
				<p:inputText id="inputJob" required="true" value="#{usersAdministrationController.userToCreate.job}"/>
				<p:message display="icon" for="inputJob"/>
				<h:outputText value="#{msgs.administrator}: " />
				<h:selectBooleanCheckbox value="#{usersAdministrationController.userToCreate.administrator}" />
				<h:panelGroup/>
				<h:outputText value="#{msgs.responsable}: " />
				<h:selectBooleanCheckbox value="#{usersAdministrationController.userToCreate.responsable}" />
				<h:panelGroup/>
			</h:panelGrid>
			<p:outputPanel layout="block" styleClass="buttonContainer center">
				<p:commandButton actionListener="#{usersAdministrationController.createUser}" image="ui-icon ui-icon-circle-plus" oncomplete="handleSaveRequest(xhr, status, args, dialogUserCreationVar)" type="submit" update="inputGrid" value="#{msgs.create}" />
				<p:commandButton image="ui-icon ui-icon-circle-close" onclick="dialogUserCreationVar.hide()" type="button" value="#{msgs.cancel}"/>
			</p:outputPanel>
		</h:form>
	</p:dialog>
</ui:composition>